﻿@model MemberPoint.Entity.ViewModel.GiftSViewModel

@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>添加礼品</title>
    <link href="~/Content/Easy UI/themes/default/easyui.css" rel="stylesheet" />
    <link href="~/Content/Easy UI/themes/icon.css" rel="stylesheet" />@*图片*@
    <script src="~/Content/Easy UI/script/jquery-1.11.1.js"></script>
    <script src="~/Content/Easy UI/script/jquery.easyui.min.js"></script>
    <script src="~/Content/Easy UI/script/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#btn").click(function () {
                var url = "/Gifts/GiftsInsert";
                var EG_ID = $("#EG_ID").val();
                if (parseInt(EG_ID) > 0) {
                    url = "/Gifts/GiftsUpdate/";
                }
                var dataForm = $("#Form_id").serializeArray();
                $.post(url, dataForm, function (data) {
                    if (data.ResultStatus == 1) {
                        window.parent.$.messager.alert("温馨提示", data.Msg, "info");
                        window.parent.$("#dlg").dialog("close");
                        window.parent.$("#dg").datagrid("reload");
                    } else {
                        //data.ResultStatus
                        window.parent.$.messager.alert("温馨提示", data.Msg, "error");

                    }
                }, "json")
            })
        })
    </script>
</head>
<body>
    <div> 
        <table>
            @using (Html.BeginForm("", "", FormMethod.Post, new { id = "Form_id" }))
            {
                <tr>
                    <td>礼品代号：</td>
                    <td>
                        @Html.EditorFor(model => model.EG_ID, new { htmlAttributes = new { @class = "form-control" } })
                    </td>
                </tr>
                <tr>
                    <td>礼品名称：</td>
                    <td>
                        @Html.EditorFor(model => model.EG_GiftName, new { htmlAttributes = new { @class = "form-control" } })
                    </td>
                </tr>
                <tr>
                    <td>礼品图片：</td>
                    <td>
                        @Html.EditorFor(model => model.EG_Photo, new { htmlAttributes = new { @class = "form-control" } })
                    </td>
                </tr>
                <tr>
                    <td>所需积分：</td>
                    <td>
                        @Html.EditorFor(model => model.EG_Point, new { htmlAttributes = new { @class = "form-control" } })
                    </td>
                </tr>
                <tr>
                    <td>礼品数量：</td>
                    <td>
                        @Html.EditorFor(model => model.EG_Number, new { htmlAttributes = new { @class = "form-control" } })
                    </td>
                </tr>
                <tr>
                    <td>备注：</td>
                    <td>
                        @Html.EditorFor(model => model.EG_Remark, new { htmlAttributes = new { @class = "form-control" } })
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <input type="button" value="操作" class="btn btn-default" id="btn" />
                    </td>
                </tr>
             }
        </table>
    </div>
</body>
</html>
